//
//  AcountListTableViewCell.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/10/28.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "AcountListTableViewCell.h"

@implementation AcountListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.DeleBtn.layer.cornerRadius=self.DeleBtn.height/2.0;
    
    self.DeleBtn.layer.masksToBounds=YES;
    
    // Initialization code
}

-(void)setModel:(SAcountList *)model
{
    _model=model;
    
    self.NameLabel.text=model.goodsName;
    
    
    if (model.unit==nil) {
        
        model.unit=@"";
    }
    
    self.QuanlityLabel.text=[NSString stringWithFormat:@"%@%@",model.quantity,model.unit];
    
    
    CGFloat totalPrice;
    
    totalPrice=[model.quantity floatValue]*[model.price floatValue];
    
    self.TotalPriceLabel.text=[NSString stringWithFormat:@"%.2f",totalPrice];
    
}

- (IBAction)DeleAction:(UIButton *)sender {
    
    _Dblock(self);
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
